package com.cn.bulu.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cn.bulu.service.HomePageService;
import com.cn.bulu.utils.BuluResult;

import android.R.integer;

@Controller
@RequestMapping("/homePage")
public class HomePageController {
	@Resource
	private HomePageService homePageService;
	//搜索商品
	@RequestMapping("/searchSample")
	@ResponseBody
	public BuluResult searchSample(String search , Integer page,Integer type){
		BuluResult buluResult = homePageService.searchSample(search, page,type);
		return buluResult;
	}
	//首页
	@RequestMapping("/selectHomePage")
	@ResponseBody
	public BuluResult selectHomePage(Integer type,Integer page){
		BuluResult buluResult = homePageService.selectHomePage(type,page);
		return buluResult;
	}
	//菜单栏获取
	@RequestMapping("/selectMenu")
	@ResponseBody
	public BuluResult selectMenu(Integer type){
		BuluResult buluResult = homePageService.selectMenu(type);
		return buluResult;
	}
	//菜单栏筛选
	@RequestMapping("/selectScreen")
	@ResponseBody
	public BuluResult selectScreen(Integer type,String brand,Integer styleId,Integer locationId,String keyword,Integer structure,Integer CG,Integer fptId,Integer AccessoriesTypeId,Integer shading,Integer page){
		BuluResult buluResult = homePageService.selectScreen(type, brand, styleId, locationId, keyword, structure, CG, fptId, AccessoriesTypeId,shading, page);
		return buluResult;
	}
	//进入商品详情
	@RequestMapping("/selectXQ")
	@ResponseBody
	public BuluResult selectXQ(Integer sampleId){
		BuluResult buluResult = homePageService.selectXQ(sampleId);
		return buluResult;
	}
	//查询商品评价
	@RequestMapping("/selectEvaluation")
	@ResponseBody
	public BuluResult selectEvaluation(Integer sampleId,Integer page){
		BuluResult buluResult = homePageService.selectEvaluation(sampleId,page);
		return buluResult;
	}
	//根据地区查询测量，安装满免
	@RequestMapping("/selectRegion")
	@ResponseBody
	public BuluResult selectRegion(String city){
		BuluResult buluResult = homePageService.selectRegion(city);
		return buluResult;
	}
	@RequestMapping("/test")
	@ResponseBody
	public BuluResult test(Integer sampleId){
		System.out.println(sampleId);
		return null;
	}
	//图文详情和测量安装
	@RequestMapping("/selectTuwen")
	@ResponseBody
	public BuluResult selectTuwen(Integer sampleId,Integer type){
		BuluResult buluResult = homePageService.selectTuwen(sampleId,type);
		return buluResult;
	}
	//测量安装
	@RequestMapping("/selectCeliang")
	@ResponseBody
	public BuluResult selectCeliang(Integer sampleId){
		BuluResult buluResult = homePageService.selectCeliang(sampleId);
		return buluResult;
	}
	//查询热搜
	@RequestMapping("/selectHotSearch")
	@ResponseBody
	public BuluResult selectHotSearch(){
		BuluResult buluResult = homePageService.selectHotSearch();
		return buluResult;
	}
	//平板图文详情
	@RequestMapping("/selectPingban")
	@ResponseBody
	public BuluResult selectPingban(Integer sampleId,Integer type){
		BuluResult buluResult = homePageService.selectPingban(sampleId,type);
		return buluResult;
	}

}
